$(document).ready(function() {
    $('#type').autoSuggest("http://node.esfriki.com/ajax.php",{result:'type_id'});
    $('#to').autoSuggest("http://node.esfriki.com/ajax.php",{result:'to_id'});
    $('#searchinput').autoSuggest("http://node.esfriki.com/ajax.php",{result:'nowhere'});
    $('#add_link').submit(function(event){ 
        if ($('#to_id').val() == '' && $('#to').val() == '') {
            event.preventDefault();
        }
    });
});